package org.xg.study.pd;

import org.xg.study.pd.util.RedisUtils;

/**
 * @author CMG
 * @version 1.0
 * @description
 * @cLassName ActivityController
 * @date 2021/9/15 16:20
 **/
public class ActivityController {
    private RedisUtils redisUtils = new RedisUtils();

    public Activity queryActivityInfo(Long id) {
        Activity activity = ActivityFactory.getActivity(id);
        // 模拟从Redis中获取库存变化信息
        Stock stock = new Stock(1000, redisUtils.getStockUsed());
        activity.setStock(stock);
        return activity;
    }
}
